<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>海晨忆的博客</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  
  
  <meta name="description" content="我负责征战天下，你负责貌美如花！">
<meta property="og:type" content="website">
<meta property="og:title" content="海晨忆的博客">
<meta property="og:url" content="https://haichenyi.com/index.html">
<meta property="og:site_name" content="海晨忆的博客">
<meta property="og:description" content="我负责征战天下，你负责貌美如花！">
<meta property="og:locale" content="zh-Hans">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="海晨忆的博客">
<meta name="twitter:description" content="我负责征战天下，你负责貌美如花！">
  
    <link rel="alternate" href="/atom.xml" title="海晨忆的博客" type="application/atom+xml">
  
  
    <link rel="icon" href="/uploads/artistic_image/head.jpg">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
  <link rel="stylesheet" href="/css/highlight.css">
  <script>
  let antiquityStorage = window.sessionStorage.getItem('antiquitySessionStorage');
  if (antiquityStorage == '' || antiquityStorage == null) {
    var antiquityLoader = '<div id="loaderbox"><div class="loader"><div class="load-roll"><div class="load-top"></div><div class="load-right"></div><div class="load-bottom"></div></div></div></div>';
    document.write(antiquityLoader);
    document.body.style.overflow = 'hidden'
  }
  </script>
</head>

<body>
  <div id="fullpage" class="mobile-nav-right">
    
      <div id="wrapper" style="background-image: url(/uploads/artistic_image/bg.jpg)" title="背景图片来自网络">
    
    
      <header id="header">
  <div id="nav-toggle" class="nav-toggle"></div>
  <div class="head-box global-width">
    <nav class="nav-box nav-right">
      
        <a class="nav-item" href="/" title
        
        >首页</a>
      
        <a class="nav-item" href="/archives" title
        
        >归档</a>
      
        <a class="nav-item" href="/about" title
        
        >简历</a>
      
    </nav>
  </div>
</header>
      <div id="middlecontent" title class="global-width sidebar-left">
        <section id="main">
  
    <article id="post-JAVA—公平锁，非公平锁，悲观锁，乐观锁，死锁" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/2021/07/27/JAVA—公平锁，非公平锁，悲观锁，乐观锁，死锁/">JAVA—公平锁，非公平锁，悲观锁，乐观锁，死锁</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2021/07/27/JAVA—公平锁，非公平锁，悲观锁，乐观锁，死锁/" class="article-date">
  <time datetime="2021-07-27T13:44:50.000Z" itemprop="datePublished">2021-07-27</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/JAVA-并发/">JAVA -并发</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud doorframe mac" itemprop="articleBody">
      
        <h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>&emsp;&emsp;这几个锁都可以从前面一篇<a href="http://haichenyi.com/2021/07/19/JAVA%E2%80%94%E7%BA%BF%E7%A8%8B%E5%90%8C%E6%AD%A5%E5%99%A8AQS/#more">线程同步器AQS</a>里面找到影子,我先把前面一篇的加锁流程图拿过来用一用。</p>
        
          <p class="article-more-link">
            <a href="/2021/07/27/JAVA—公平锁，非公平锁，悲观锁，乐观锁，死锁/#more">阅读全文</a>
          </p>
        
      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-JAVA—线程同步器AQS" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/2021/07/19/JAVA—线程同步器AQS/">JAVA—线程同步器AQS</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2021/07/19/JAVA—线程同步器AQS/" class="article-date">
  <time datetime="2021-07-19T14:41:15.000Z" itemprop="datePublished">2021-07-19</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/JAVA-并发/">JAVA -并发</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud doorframe mac" itemprop="articleBody">
      
        <h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>&emsp;&emsp;每一项技术的提出都是为了解决某一个问题，带着问题来理解技术，使得印象你对这个技术的理解印象更加深刻。</p>
        
          <p class="article-more-link">
            <a href="/2021/07/19/JAVA—线程同步器AQS/#more">阅读全文</a>
          </p>
        
      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-Android模拟点击" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/2021/07/07/Android模拟点击/">Android模拟点击</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2021/07/07/Android模拟点击/" class="article-date">
  <time datetime="2021-07-07T13:32:21.000Z" itemprop="datePublished">2021-07-07</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Android-常用功能/">Android -常用功能</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud doorframe mac" itemprop="articleBody">
      
        <p>&emsp;&emsp;本篇介绍实现模拟点击的两种方式：</p>
<ol>
<li>performClick();</li>
<li><p>MotionEvent事件</p>
        
          <p class="article-more-link">
            <a href="/2021/07/07/Android模拟点击/#more">阅读全文</a>
          </p>
        
      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-SpringBoot系列-消息-RabbitMQ-（二十）" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/11/27/SpringBoot系列-消息-RabbitMQ-（二十）/">SpringBoot系列-消息(RabbitMQ)（二十）</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2019/11/27/SpringBoot系列-消息-RabbitMQ-（二十）/" class="article-date">
  <time datetime="2019-11-27T06:44:45.000Z" itemprop="datePublished">2019-11-27</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-SpringBoot/">Java -SpringBoot</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud doorframe mac" itemprop="articleBody">
      
        <p>&emsp;&emsp;大多数应用当中，可通过消息服务中间件来提升系统的异步通信和扩展解耦能力。</p>
        
          <p class="article-more-link">
            <a href="/2019/11/27/SpringBoot系列-消息-RabbitMQ-（二十）/#more">阅读全文</a>
          </p>
        
      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-SpringBoot系列-Docker（十九）" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/11/13/SpringBoot系列-Docker（十九）/">SpringBoot系列-Docker（十九）</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2019/11/13/SpringBoot系列-Docker（十九）/" class="article-date">
  <time datetime="2019-11-13T06:44:37.000Z" itemprop="datePublished">2019-11-13</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-SpringBoot/">Java -SpringBoot</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud doorframe mac" itemprop="articleBody">
      
        <h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p>&emsp;&emsp;Docker 是一个开源的应用容器引擎，基于 Go 语言 并遵从Apache2.0协议开源。<br>Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级、可移植的容器中，<br>然后发布到任何流行的 Linux 机器上，也可以实现虚拟化。</p>
        
          <p class="article-more-link">
            <a href="/2019/11/13/SpringBoot系列-Docker（十九）/#more">阅读全文</a>
          </p>
        
      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-SpringBoot系列-Run启动原理（十八）" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/11/11/SpringBoot系列-Run启动原理（十八）/">SpringBoot系列—Run启动原理（十八）</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2019/11/11/SpringBoot系列-Run启动原理（十八）/" class="article-date">
  <time datetime="2019-11-11T09:28:35.000Z" itemprop="datePublished">2019-11-11</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-SpringBoot/">Java -SpringBoot</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud doorframe mac" itemprop="articleBody">
      
        <p>&emsp;&emsp;需要搞清楚几个重要的事件回调机制</p>
<p>配置在META-INF/spring.factories</p>
<ul>
<li>ApplicationContextInitializer</li>
<li>SpringApplicationRunListener</li>
</ul>
<p>只需要放在ioc容器中</p>
<ul>
<li><p>ApplicationRunner </p>
</li>
<li><p>CommandLineRunner</p>
</li>
</ul>
        
          <p class="article-more-link">
            <a href="/2019/11/11/SpringBoot系列-Run启动原理（十八）/#more">阅读全文</a>
          </p>
        
      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-SpringBoot系列—Redis（十七）" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/11/06/SpringBoot系列—Redis（十七）/">SpringBoot系列—Redis（十七）</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2019/11/06/SpringBoot系列—Redis（十七）/" class="article-date">
  <time datetime="2019-11-06T08:40:38.000Z" itemprop="datePublished">2019-11-06</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-SpringBoot/">Java -SpringBoot</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud doorframe mac" itemprop="articleBody">
      
        <p>&emsp;&emsp;前面一篇说到了spring boot自带的缓存SimpleCache，我们也聊到了他的底层实际上就是HashMap，并且这个缓存是放在内存当中的，这样弊端也是有的，比如：内存大小，当服务器关闭之后，缓存就没了等等。</p>
        
          <p class="article-more-link">
            <a href="/2019/11/06/SpringBoot系列—Redis（十七）/#more">阅读全文</a>
          </p>
        
      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-SpringBoot系列—缓存及其源码分析（十六）" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/11/05/SpringBoot系列—缓存及其源码分析（十六）/">SpringBoot系列—缓存及其源码分析（十六）</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2019/11/05/SpringBoot系列—缓存及其源码分析（十六）/" class="article-date">
  <time datetime="2019-11-05T02:52:46.000Z" itemprop="datePublished">2019-11-05</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-SpringBoot/">Java -SpringBoot</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud doorframe mac" itemprop="articleBody">
      
        <p>&emsp;&emsp;缓存是每个项目都用到的为了提高接口响应效率，降低数据库的查询压力，从而提高系统性能。所以，缓存对于一个项目来说是至关重要的。</p>
        
          <p class="article-more-link">
            <a href="/2019/11/05/SpringBoot系列—缓存及其源码分析（十六）/#more">阅读全文</a>
          </p>
        
      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-SpringBoot系列—邮件（十五）" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/10/31/SpringBoot系列—邮件（十五）/">SpringBoot系列—邮件（十五）</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2019/10/31/SpringBoot系列—邮件（十五）/" class="article-date">
  <time datetime="2019-10-31T09:12:19.000Z" itemprop="datePublished">2019-10-31</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-SpringBoot/">Java -SpringBoot</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud doorframe mac" itemprop="articleBody">
      
        <p>&emsp;&emsp;邮件发送是必不可少的，不管是注册邮件，还是广告。</p>
        
          <p class="article-more-link">
            <a href="/2019/10/31/SpringBoot系列—邮件（十五）/#more">阅读全文</a>
          </p>
        
      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-SpringBoot系列—异步任务与定时任务（十四）" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/10/31/SpringBoot系列—异步任务与定时任务（十四）/">SpringBoot系列—异步任务与定时任务（十四）</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2019/10/31/SpringBoot系列—异步任务与定时任务（十四）/" class="article-date">
  <time datetime="2019-10-31T06:32:20.000Z" itemprop="datePublished">2019-10-31</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-SpringBoot/">Java -SpringBoot</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud doorframe mac" itemprop="articleBody">
      
        <h3 id="异步任务"><a href="#异步任务" class="headerlink" title="异步任务"></a>异步任务</h3><p>&emsp;&emsp;什么时候用异步，就是耗时操作的时候就可以用到异步，比如：批量处理数据，批量发邮件等等。</p>
        
          <p class="article-more-link">
            <a href="/2019/10/31/SpringBoot系列—异步任务与定时任务（十四）/#more">阅读全文</a>
          </p>
        
      
    </div>
    
  </div>
  
  
</article>

  


  <nav id="page-nav">
    
    <span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="page-number" href="/page/3/">3</a><span class="space">&hellip;</span><a class="page-number" href="/page/8/">8</a><a class="extend next" rel="next" href="/page/2/">下一页 &raquo;</a>
  </nav>


</section>
        <aside id="sidebar">
  
    <div class="widget-box">
  <div class="avatar-box avatar-item">
    <img class="avatar" src="/uploads/artistic_image/head.jpg" title="头像来自网络"></img>
    <h3 class="avatar-name">
      
        海晨忆
      
    </h3>
    <p class="avatar-slogan">
      先谋生，再谋爱。人间值得，未来可期。
    </p>
  </div>
</div>


  
    
  <div class="widget-box">
    <h3 class="widget-title">分类</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Android-Socket/">Android -Socket</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Android-加密算法/">Android -加密算法</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Android-常用功能/">Android -常用功能</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Android-框架/">Android -框架</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Android-源码解析/">Android -源码解析</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Android-自定义view/">Android -自定义view</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Android-设计模式/">Android -设计模式</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/JAVA-并发/">JAVA -并发</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Java-SpringBoot/">Java -SpringBoot</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Tomcat/">Tomcat</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/kotlin/">kotlin</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/数据库-JDBC/">数据库 -JDBC</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/数据库-MySQL/">数据库 -MySQL</a></li></ul>
    </div>
  </div>


  
    

  
    
  
    
  <div class="widget-box">
    <h3 class="widget-title">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/07/">July 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/11/">November 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/10/">October 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/09/">September 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">August 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/07/">July 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">June 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/10/">October 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/05/">May 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/03/">March 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/02/">February 2018</a></li></ul>
    </div>
  </div>

  
    
  <div class="widget-box">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2021/07/27/JAVA—公平锁，非公平锁，悲观锁，乐观锁，死锁/">JAVA—公平锁，非公平锁，悲观锁，乐观锁，死锁</a>
          </li>
        
          <li>
            <a href="/2021/07/19/JAVA—线程同步器AQS/">JAVA—线程同步器AQS</a>
          </li>
        
          <li>
            <a href="/2021/07/07/Android模拟点击/">Android模拟点击</a>
          </li>
        
          <li>
            <a href="/2019/11/27/SpringBoot系列-消息-RabbitMQ-（二十）/">SpringBoot系列-消息(RabbitMQ)（二十）</a>
          </li>
        
          <li>
            <a href="/2019/11/13/SpringBoot系列-Docker（十九）/">SpringBoot系列-Docker（十九）</a>
          </li>
        
      </ul>
    </div>
  </div>

  
      <div class="widget-box">
    <h3 class="widget-title">友情链接</h3>
    <div class="widget">
      
        <a class="hrf" style="display: block;" href="https://github.com/haichenyi" title target='_blank'
        >Github</a>
      
        <a class="hrf" style="display: block;" href="https://www.jianshu.com/u/6077ee440c37" title target='_blank'
        >简书</a>
      
        <a class="hrf" style="display: block;" href="https://blog.csdn.net/qq_27634797" title target='_blank'
        >CSDN</a>
      
    </div>
  </div>

  
</aside>
      </div>
      <footer id="footer">
  <div class="foot-box footers global-width">
    &copy;2017-2021 海晨忆 &nbsp;&nbsp;
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span id="busuanzi_container_site_pv">阁下是第<span id="busuanzi_value_site_pv"></span>个访客</span>
  </div>
</footer>
      <script src="https://code.jquery.com/jquery-2.0.3.min.js"></script>
<script>
if (!window.jQuery) {
var script = document.createElement('script');
script.src = "/js/jquery-2.0.3.min.js";
document.body.write(script);
}
</script>

  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



    </div>
    <nav id="mobile-nav" class="mobile-nav-box">
  <div class="mobile-nav-img mobile-nav-top"></div>
  
    <a href="/" class="mobile-nav-link">首页</a>
  
    <a href="/archives" class="mobile-nav-link">归档</a>
  
    <a href="/about" class="mobile-nav-link">简历</a>
  
  <div class="mobile-nav-img  mobile-nav-bottom"></div>
</nav>    
  </div>
</body>
</html>